<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<title>上传和下载</title>

	</head>

	<body>
		<form  id="addform" method="POST" enctype="MULTIPART/FORM-DATA" align="center" action="/AddPhotoServlet">
			<table>
			<tr>
				<td>照片:</td>
				<td>
					<input type="file" name="photo" id="photo" size="30" />
				</td>
				</tr>
				<tr>
				<td>身份证:</td>
				<td>
					<input type="file" name="idcard" id="idcard" size="30" />
				</td>
				</tr>
				<tr>
				<td>学历:</td>
				<td>
					<input type="file" name="educationimg" id="educationimg" size="30" />
				</td>
				</tr>
				<tr  >
					<td >
						<input type="button" value="上 传" onclick="addempphoto()">
					</td>
				</tr>
			</table>
		</form>
	</body>
</html>
<script type="text/javascript">
function addempphoto() {
	document.getElementById("addform").submit();
	 /* photoStr=document.getElementById("photo").value;   
	  photoEx=photoStr.substring(photoStr.lastIndexOf("."));
	  idcardStr=document.getElementById("idcard").value;   
	  idcardEx=idcardStr.substring(idcardStr.lastIndexOf("."));
	  educationimgStr=document.getElementById("educationimg").value;   
	  educationimgEx=educationimgStr.substring(educationimgStr.lastIndexOf("."));
	  */
	 /* if(photoEx==".jpg"){ 
		  if(idcardEx==".jpg")
			  {
			  	if(educationimgEx==".jpg")
			  		{
			  		
			  		}
			  	else
			  		{
			  		 alert("上传图片只能是.jpg格式的！");   
			  		}
			  }
		  else
			  {
			  alert("上传图片只能是.jpg格式的！");   
			  }
		 
	  }else{   
		  alert("上传图片只能是.jpg格式的！");   
	  return;   
	  }
	*/
}
</script>